package edu.hawaii.wattwaiter;

//import org.apache.wicket.Application;
import org.apache.wicket.Application;
import org.apache.wicket.Page;
import org.apache.wicket.Request;
import org.apache.wicket.Response;
import org.apache.wicket.Session;
import org.apache.wicket.protocol.http.WebApplication;
import edu.hawaii.wattwaiter.page.WattWaiterSession;

/**
 * This top-level class is required to specify the Wicket WebApplication.
 * 
 * @author Philip Johnson
 */
public class WattWaiterStart extends WebApplication {

  /**
   * Return the home page for this application.
   * 
   * @return The home page.
   */
  @Override
  public Class<? extends Page> getHomePage() {
    return edu.hawaii.wattwaiter.page.BasePage.class;
  }

  /**
   * Return a session object to hold the models for each user of this application.
   * 
   * @param request The http request.
   * @param response The http response.
   * @return The session instance for this user.
   */
  @Override
  public Session newSession(Request request, Response response) {

    return new WattWaiterSession(this, request);
  }

  /**
   * Changes the program into Deployment mode.
   * @return deployment mode
   */
  
  @Override
  public String getConfigurationType() {
    return Application.DEPLOYMENT;
  }
  
  
  /**
   * Return this webapp. Using this, you can get the session for your current user instance.
   * 
   * @return The webapp.
   */
  public static WattWaiterStart get() {
    return (WattWaiterStart) WebApplication.get();
  }
}
